#include<iostream>
#include<string>
using namespace std;
int main(){
  string s,t;
  int q,x,y;
  cin>>s>>t>>q;
  while(q--){
    cin>>x>>y;
    string s1(s.begin()+x-1,s.begin()+y);
    cin>>x>>y;
    string s2(t.begin()+x-1,t.begin()+y);
    auto flag=s1<=>s2;
    if(flag<0)cout<<"yifusuyi"<<endl;
    else if(flag>0)cout<<"erfusuer"<<endl;
    else cout<<"ovo"<<endl;
  }
}